package com.travel.exception;

import com.qianfeng.util.ResultMsg;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class Myexception {

    @ExceptionHandler(OrderAddFailureException.class)
    public ResultMsg OrderAddFailure(OrderAddFailureException e){
        return ResultMsg.error(301,"网络繁忙，请稍后重试");
    }

    @ExceptionHandler(LoginAddFailureException.class)
    public ResultMsg LoginAddFailure(LoginAddFailureException e){
        return ResultMsg.error(104,"登录繁忙，请稍后重试");
    }

}
